# 定义模块路径
##################################
########用户配置区#################
MODULE1 = ChatRoom/Client
MODULE2 = ChatRoom/Service

MODULE1_TARGET = $(MODULE1)/main
MODULE2_TARGET = $(MODULE2)/main

MODULES = $(MODULE1) $(MODULE2)
MODULES_TARGET = $(MODULE1_TARGET) $(MODULE2_TARGET)
##################################
# 默认目标
all: $(MODULES_TARGET)

# 构建模块
$(MODULE1_TARGET): $(MODULE1)
	@echo "正在编译模块：$(MODULE1)"
	$(MAKE) -C $(MODULE1) all

$(MODULE2_TARGET): $(MODULE2)
	@echo "正在编译模块：$(MODULE2)"
	$(MAKE) -C $(MODULE2) all

# 清理所有模块
clean:
	$(MAKE) -C $(MODULE1) clean
	$(MAKE) -C $(MODULE2) clean
	rm -f $(MODULE1_TARGET) $(MODULE2_TARGET)

# 帮助信息
help:
	@echo "可用命令:"
	@echo "  make          编译所有模块"
	@echo "  make clean    清理所有模块"
	@echo "  make help     查看帮助信息"
